'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);

  router.get('/api/role', controller.role.index);
  router.post('/api/role', controller.role.create);
  router.delete('/api/role/:id', controller.role.destroy);
  router.put('/api/role/:id', controller.role.update);

  router.post('/api/user/signup', controller.user.create);
  router.post('/api/user/login', controller.user.login);
  router.post('/api/user/update', app.jwt, controller.user.update);
};
